package com.cy.sys.controller;

import com.cy.common.pojo.JsonResult;
import com.cy.common.pojo.PageObject;
import com.cy.sys.pojo.SysLog;
import com.cy.sys.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/log/")
public class SysLogController {
    @Autowired
    private SysLogService sysLogService;

    //@RequestMapping(value="doDeleteObjects/{ids}",method = RequestMethod.DELETE)
    @DeleteMapping("doDeleteObjects/{ids}")
    public JsonResult doDeleteObjects(@PathVariable Integer... ids){
        sysLogService.deleteObjects(ids);
        return new JsonResult("delete ok");
    }

    @GetMapping("doFindPageObjects")
    @ResponseBody
    public JsonResult doFindPageObjects(String username,Integer pageCurrent){
        PageObject<SysLog> pageObject=sysLogService.findPageObjects(username,pageCurrent);
        return new JsonResult(pageObject);//封装的是正确的响应结果
    }
}
